home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / xv_pc17.zip / TABKEYS.INC < prev    next >
Text File  |  1994-06-24  |  1KB  |  50 lines

  1. {
  2. Object selection using the Tab key for the XView-PC interface
  3. By Antonio Carlos Moreirao de Queiroz - acmq@coe.ufrj.br
  4. Version 1.0 - 10/04/94
  5. Version 1.0a - 30/04/94 Ctrl-Tab moves up
  6. Version 1.0b - 24/06/94 Operation with the mouse emulator corrected
  7.  
  8. This procedure moves the mouse cursor to the next object in the active
  9. window when the Tab key is pressed, using the "interposer".
  10. The Shift-Tab key moves the cursor to the top of the next window.
  11. The Return key is equivalent to the mouse left button.
  12. To install, include this file in the program, and insert after "xv_init"
  13. the statement: interposer:=TabKeys;
  14. The program must use the units Mickey and XView.
  15. }
  16.  
  17. {$I extkeys.inc}
  18.  
  19. {$F+}
  20.  
  21. PROCEDURE TabKeys;
  22. VAR
  23.   pto,ptw:Xv_opaque;
  24.   mx,my:INTEGER;
  25. BEGIN
  26.   ptw:=active_w; pto:=nil;
  27.   IF ie_code=kTab THEN BEGIN
  28.     IF active_o<>nil THEN pto:=active_o^.next
  29.     ELSE pto:=ptw^.next
  30.   END
  31.   ELSE IF ie_code=kShiftTab THEN ptw:=ptw^.over
  32.   ELSE IF ie_code=kCr THEN BEGIN
  33.     ie_code:=MS_LEFT;
  34.     Exit
  35.   END
  36.   ELSE Exit;
  37.   IF pto=nil THEN BEGIN
  38.     mx:=ptw^.x+ptw^.dx div 2;
  39.     my:=ptw^.y+mrgy div 2;
  40.     open_window(ptw);
  41.   END
  42.   ELSE BEGIN
  43.     mx:=ptw^.x+mrgx+pto^.x+pto^.dx div 2;
  44.     my:=ptw^.y+mrgy+pto^.y+pto^.dy div 2;
  45.   END;
  46.   mouse_move(mx,my);
  47. END;
  48.  
  49. {$F-}
  50.